home *** CD-ROM | disk | FTP | other *** search
- Components.utils.import("resource://samfind/rss/samfind_modrssutils.jsm");
-
- var EXPORTED_SYMBOLS = ["samfindRSSGetLink", "samfindRSSGetTitle", "samfindRSSGetDate", "samfindRSSGetImage", "samfindRSSGetContent"];
-
- function samfindRSSGetLink(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetTitle(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetDate(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetImage(websiteRssUrl, item)
- {
- return null;
- }
-
- function samfindRSSGetContent(websiteRssUrl, item, title, link)
- {
- var content = (item.getElementsByTagName("content"))[0];
- if (!content)
- {
- return null;
- }
- content = content.textContent;
- content = content.replace(/&(lt|gt);/g, function(strMatch, p1){return (p1 == "lt") ? "<" : ">";});
- content = content.replace(/<br>/, "<br/>");
- content = content.replace(/.gif">/g, ".gif\"/>");
- content = content.replace(/.jpg">/g, ".jpg\"/>");
- var start = content.indexOf("<span>");
- if (start == -1)
- {
- return null;
- }
- start += 6;
- var end = content.indexOf("</span>", start);
- var response = content.substring(start, end);
- response = samfind_modrssutils.truncate(response, 12) + "<br/>";
- response = samfind_modrssutils.removeRubbish(response);
- start = content.indexOf("Views:</span>");
- if (start != -1)
- {
- start += 13;
- end = content.indexOf("</div>", start);
- if (end != -1)
- {
- response += "<span class=\"left\">" + content.substring(start, end) + " views</span><br/>";
- }
- }
- start = content.indexOf("Time:</span>");
- if (start != -1)
- {
- start += 12;
- end = content.indexOf("</span>", start);
- if (end != -1)
- {
- response += content.substring(start, end).replace("style=\"color: #000000; font-size: 11px; font-weight: bold;\"", "") + "</span> ";
- }
- }
- start = content.indexOf("From:</span>");
- if (start != -1)
- {
- start += 12;
- end = content.indexOf("</div>", start);
- if (end != -1)
- {
- response += content.substring(start, end) + "<br/>";
- }
- }
- start = content.indexOf("<img style=\"border: 0px none;");
- while (start != -1)
- {
- end = content.indexOf(".gif\"/>", start);
- if (end == -1)
- {
- break;
- }
- else
- {
- end += 7;
- response += content.substring(start, end);
- start = content.indexOf("<img style=\"border: 0px none;", end);
- }
- }
- response += "<br/>";
- start = content.indexOf("More in</span>");
- if (start != -1)
- {
- start += 14;
- end = content.indexOf("</td>", start);
- if (end != -1)
- {
- response += "<span class=\"left\">More in:</span> " + content.substring(start, end).replace("categories_portal", "browse");
- }
- }
- response = samfind_modrssutils.HTML2Unicode(response);
- return response;
- }